import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:guochaoapp/common/constant/order_constant.dart';
import 'package:guochaoapp/common/constant/to_order_detail_source.dart';
import 'package:guochaoapp/common/widges/appbar.dart';
import 'package:guochaoapp/controller/shopping/shopping_controller.dart';
import 'package:guochaoapp/controller/shopping/shopping_settle_controller.dart';
import 'package:guochaoapp/model/order_detail_entity.dart';
import 'package:guochaoapp/model/payment_entity.dart';
import 'package:guochaoapp/model/transterpay_entity.dart';
import 'package:guochaoapp/routes/app_pages.dart';

import '../../r.dart';

class GCPaymentTransferPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // OrderDetailDataReceiptCardDTO _data = Get.arguments[0];
    // double _price = Get.arguments[1];
    return Scaffold(
      appBar: GCAppBar(titleText: "对公银行账户", whiteStyle: true),
    body: _initSubviews());
  }

  _initSubviews() {
    GCShoppingSettleController shoppingSettleController = Get.find();

    TransterpayDataReceiptCard transterpayDataReceiptCard = Get.arguments["data"];

    return Column(
      children: [
//        SizedBox(
//          height: ScreenUtil().statusBarHeight,
//          child: Container(color: Colors.white),
//        ),
//        Container(
//          color: Colors.white,
//          height: 44,
//          child: Align(
//              child: Text("对公银行账户",
//                  style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold))),
//        ),
        Divider(
          height: 1,
          color: Color(0xFFE9F2ED),
        ),
        Container(
          color: Colors.white,
          height: 64,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text("请将于",
                      style: TextStyle(fontSize: 14, color: Color(0xFF8c8c8c))),
                  Text("24小时",
                      style: TextStyle(fontSize: 16, color: Colors.red)),
                  Text("内支付至对公银行账户",
                      style: TextStyle(fontSize: 14, color: Color(0xFF8c8c8c))),
                ],
              ),
              Row(mainAxisAlignment: MainAxisAlignment.center, children: [
                Align(
                    child: Text("如超时订单将需您重新处理",
                        style: TextStyle(fontSize: 14, color: Colors.red)))
              ]),
            ],
          ),
        ),
        Divider(
          height: 1,
          color: Color(0xFFE9F2ED),
        ),
        Container(
          color: Color(0xFFFFF8F7),
          height: 64,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Row(mainAxisAlignment: MainAxisAlignment.center, children: [
                Align(
                    child: Text("待付款金额",
                        style:
                            TextStyle(color: Color(0xFF8C8887), fontSize: 12)))
              ]),
              Row(mainAxisAlignment: MainAxisAlignment.center, children: [
                Align(
                    child: Text("￥" + shoppingSettleController.getPaymentPrice().toString(),
                        style: TextStyle(color: Colors.red, fontSize: 18)))
              ]),
            ],
          ),
        ),
        Divider(
          height: 1,
          color: Color(0xFFE9F2ED),
        ),
        Container(
          color: Colors.white,
          child: Column(
            children: [
              Container(
                height: 55,
                child: Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      SizedBox(width: 12),
                      Text("对公账户信息",
                          style: TextStyle(
                              fontSize: 16, fontWeight: FontWeight.w500)),
                    ]),
              ),
              Divider(
                height: 1,
                color: Color(0xFFE9F2ED),
              ),
              Container(
                height: 40,
                child: Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      SizedBox(width: 12),
                      Expanded(
                          child: Text("公司名称", style: TextStyle(fontSize: 13)),
                          flex: 6),
                      Expanded(
                          child: Text(transterpayDataReceiptCard.companyName,
                              style: TextStyle(fontSize: 13)),
                          flex: 18),
                    ]),
              ),
              Padding(
                  padding: EdgeInsets.only(left: 12, right: 12),
                  child: Divider(
                    height: 1,
                    color: Color(0xFFE9F2ED),
                  )),
              Container(
                height: 40,
                child: Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      SizedBox(width: 12),
                      Expanded(
                          child: Text("银行", style: TextStyle(fontSize: 13)),
                          flex: 6),
                      Expanded(
                          child: Text(transterpayDataReceiptCard.bankName,
                              style: TextStyle(fontSize: 13)),
                          flex: 18),
                    ]),
              ),
              Padding(
                  padding: EdgeInsets.only(left: 12, right: 12),
                  child: Divider(
                    height: 1,
                    color: Color(0xFFE9F2ED),
                  )),
              Container(
                height: 40,
                child: Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      SizedBox(width: 12),
                      Expanded(
                          child: Text("分行", style: TextStyle(fontSize: 13)),
                          flex: 6),
                      Expanded(
                          child: Text(transterpayDataReceiptCard.branchName, style: TextStyle(fontSize: 13)),
                          flex: 18),
                    ]),
              ),
              Padding(
                  padding: EdgeInsets.only(left: 12, right: 12),
                  child: Divider(
                    height: 1,
                    color: Color(0xFFE9F2ED),
                  )),
              Container(
                height: 40,
                child: Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      SizedBox(width: 12),
                      Expanded(
                          child: Text("卡号", style: TextStyle(fontSize: 13)),
                          flex: 6),
                      Expanded(
                          child: Text(transterpayDataReceiptCard.cardNo,
                              style: TextStyle(fontSize: 13)),
                          flex: 18),
                    ]),
              ),
            ],
          ),
        ),
        SizedBox(height: ScreenUtil().setSp(30)),
        Container(
          width: ScreenUtil().setSp(320),
          height: ScreenUtil().setSp(42),
          child: FlatButton.icon(
            icon: Image.asset(R.assetsIconOrder,
                height: ScreenUtil().setSp(18),
                width: ScreenUtil().setSp(18)),
            label: Text("查看订单"),
            padding: EdgeInsets.zero,
            color: Color(0xFF40A8B3),
            textColor: Colors.white,
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(4))),
            onPressed: () {
              // c.jumpToList(c.settleData.itemList);
              Get.toNamed(Routes.ORDER_DETAIL, arguments: [Get.arguments["mallOrderNo"], OrderConstant.statusInit, ToOrderDetailSource.transferTo]);
            },
          ),
        ),
        SizedBox(height: ScreenUtil().setSp(24)),
        Container(
          width: ScreenUtil().setSp(320),
          height: ScreenUtil().setSp(42),
          child: OutlineButton.icon(
            icon: Image.asset(R.assetsIconBackHome,
                height: ScreenUtil().setSp(18),
                width: ScreenUtil().setSp(18)),
            label: Text("回到首页"),
            padding: EdgeInsets.zero,
            // color: Color(0xFF40A8B3),
            textColor: Color(0xFF999999),
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(4))),
            onPressed: () {
              Get.back();
              Get.back();
              Get.back();
              GCShoppingController shopping_c = Get.find();
              shopping_c.requestInitData();
//               c.jumpToList(c.settleData.itemList);
            },
          ),
        ),
      ],
    );
  }
}
